﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using HousingInfo.Library;

namespace Admin.Admin
{
    public partial class DeleteExpiredNews : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            //if ((Session["LOGIN"] == null) || (int)Session["ROLES"] != 1)
            //{
            //    Response.Redirect("Login.aspx");
            //}

            //if (NewsBOList.CountExpiredNews() == 0)
            //    btnDeleteAll.Visible = false;
            //else
            //    btnDeleteAll.Visible = true;
           
        }

      

        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            //if (e.CommandName == "Xoa")
            //{                
            //    string newsId = ((Label)(((Control)e.CommandSource).Parent.Parent).FindControl("lblMatin")).Text;
            //    try
            //    {
            //        NewsBO.DeleteNewsBO(int.Parse(newsId));
            //        message.Text = "Xóa tin thành công !";
            //        GridView1.DataBind();
            //    }
            //    catch
            //    {
            //      message.Text = "Xóa thất bại !";
            //    }
            //}
        }

        protected void btnDeleteAll_Click(object sender, EventArgs e)
        {
            //try
            //{
            //    NewsBOList.DeleteExpiredNews();
            //    message.Text = "Xóa tất cả thành công";
            //    GridView1.DataBind();
            //}

            //catch
            //{
            //    message.Text = "Xóa tất cả thất bại";
            //}
        }


    }
}
